import { locations } from "../../../../gpu/locations";
export const HemisLight_def = /*wgsl*/ `
#if ~{def.hemisLight}
@group(${locations.hemisLight[0]}) @binding(${locations.hemisLight[1]}) var<uniform> hemisLight : HemisLight;
struct HemisLight {
    skyColor:vec4<f32>,
    groundColor:vec4<f32>
}
fn calc_hemisphereLight(hemiLight: HemisLight, normal: vec3<f32>, materialColor: vec3<f32>) -> vec3<f32>{
    var direction:vec3<f32> = vec3(0,0,1);
    var dotNL:f32 = dot( normal, direction );
    var hemiDiffuseWeight: f32 = 0.5 * dotNL + 0.5;
    var irradiance:vec3<f32> = mix( hemiLight.groundColor.xyz, hemiLight.skyColor.xyz, hemiDiffuseWeight );
    let out:vec3<f32>=irradiance*materialColor.xyz;
    return out;
}
#endif`